<?php
// +----------------------------------------------------------------------
// | 随访系统
// +----------------------------------------------------------------------
// | Copyright (c) 2018-2050 http://www.hedesoft.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +---------------------------------------------------------------------
// | Author: 小李子 < 490959289@qq.com>
// +----------------------------------------------------------------------
namespace app\admin\controller;

use app\admin\controller\Base;
use think\Validate;
class User extends Base
{
	//会员管理
    public function index()
    {
    	$where = array();
        $where['is_del'] = 0;
        $q = $this->request->param('q');
        if ($q){
             $where['patient_code|uname|phone'] = array('LIKE', '%'.$q.'%');
        }
        $status = $this->request->param('status');
        if ($status){
        	$where['status'] = $status-1;
        }
        $list = model('User')->where($where)->order('ctime desc')->paginate(15);
        $page = $list->render();
        $this->assign('list', $list);
        $this->assign('page', $page);
        $user_status = model('Attribute')->getAttrNameList('user_status');
        $this->assign('user_status', $user_status);
        return $this->fetch();
    }
}
